<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE html>
<html>
<head>
    <title>我的收藏</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link type="text/css" rel="stylesheet" href="css/bootstrap.css">
    <link type="text/css" rel="stylesheet" href="css/style.css">
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="js/bootstrap.min.js"></script>
    <script type="text/javascript" src="js/simpleCart.min.js"></script>
    <script type="text/javascript" src="layer/layer.js"></script>
    <script type="text/javascript" src="js/cart.js"></script>
    <style type="text/css">
        .favorite-btn {
            display: block;
            margin: 10px 0;
            padding: 5px 10px;
            text-align: center;
            width: 100%;
        }
        .btn-group-fav {
            margin-top: 10px;
            display: block;
        }
    </style>
</head>
<body>

<!-- 引入header.jsp -->
<jsp:include page="/header.jsp">
    <jsp:param name="flag" value="6"></jsp:param>
</jsp:include>

<!-- 收藏列表 -->
<div class="products">
    <div class="container">
        <h2>我的收藏</h2>
        
        <c:choose>
            <c:when test="${empty p.list}">
                <div class="alert alert-info">
                    <h4>您还没有收藏任何商品！</h4>
                </div>
            </c:when>
            <c:otherwise>
                <div class="col-md-12 product-model-sec">
                    <c:forEach items="${p.list}" var="g">
                        <div class="product-grid">
                            <a href="/goods_detail?id=${g.id}">
                                <div class="more-product"><span> </span></div>
                                <div class="product-img b-link-stripe b-animate-go thickbox">
                                    <img src="${g.cover}" class="img-responsive" alt="${g.name}" width="240" height="240">
                                    <div class="b-wrapper">
                                        <h4 class="b-animate b-from-left b-delay03">
                                            <button>查看详情</button>
                                        </h4>
                                    </div>
                                </div>
                            </a>
                            <div class="product-info simpleCart_shelfItem">
                                <div class="product-info-cust prt_name">
                                    <h4>${g.name}</h4>
                                    <span class="item_price">¥ ${g.price}</span>
                                    <div class="clearfix"></div>
                                    <a href="favorite_delete?goodsid=${g.id}&from=list" class="favorite-btn btn btn-warning">
                                        <span class="glyphicon glyphicon-heart-empty"></span> 取消收藏
                                    </a>
                                    <input type="button" class="item_add items favorite-btn btn-primary" value="加入购物车" onclick="buy(${g.id})">
                                    <div class="clearfix"></div>
                                </div>
                            </div>
                        </div>
                    </c:forEach>
                </div>
                
                <!-- 分页 -->
                <jsp:include page="page.jsp">
                    <jsp:param name="url" value="/favorite_list"/>
                </jsp:include>
            </c:otherwise>
        </c:choose>
        
    </div>
</div>

<!-- 引入footer.jsp -->
<jsp:include page="/footer.jsp"></jsp:include>

</body>
</html> 